package com.difsonapps.contacttranslator.service.impl;

import java.util.*;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.difsonapps.contacttranslator.dao.EmailDAO;
import com.difsonapps.contacttranslator.dto.EmailDTO;
import com.difsonapps.contacttranslator.service.itf.EmailService;

@Repository
@Transactional
public class EmailServiceImpl implements EmailService {
	@Autowired
	protected EmailDAO emailDAO;

	@Transactional
	public void insert(EmailDTO emailDTO) {
		emailDAO.insert(emailDTO);
	}

	@Transactional
	public void update(EmailDTO emailDTO) {
		emailDAO.update(emailDTO);
	}

	@Transactional
	public EmailDTO get(int id) {
		return emailDAO.get(id);
	}

	@SuppressWarnings("unchecked")
	@Transactional
	public List<EmailDTO> getAll() {
		return emailDAO.getAll();
	}

	@Transactional
	public void delete(EmailDTO emailDTO) {
		emailDAO.delete(emailDTO);
	}
}
